//
//  NSTimer+ZB.m
//  PaoPao
//
//  Created by xzb on 2018/4/3.
//  Copyright © 2018年 paopao. All rights reserved.
//

#import "NSTimer+ZB.h"

@implementation NSTimer (ZB)
/**
 *  @brief  暂停NSTimer
 */
-(void)zb_pauseTimer
{
    if (![self isValid]) {
        return ;
    }
    [self setFireDate:[NSDate distantFuture]];
}
/**
 *  @brief  开始NSTimer
 */
-(void)zb_resumeTimer
{
    if (![self isValid]) {
        return ;
    }
    [self setFireDate:[NSDate date]];
}
/**
 *  @brief  延迟开始NSTimer
 */
- (void)zb_resumeTimerAfterTimeInterval:(NSTimeInterval)interval
{
    if (![self isValid]) {
        return ;
    }
    [self setFireDate:[NSDate dateWithTimeIntervalSinceNow:interval]];
}
@end
